<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="CentOS 安装配置 1, 个人博客">
    <meta name="description" content="Centos安装配置 1简单修改
【创建虚拟机的配置】如果要想在虚拟机进行CentOS系统的安装，则一定要创建由一个新的虚拟机环境，同时在安装的过程之中尽可能提供较大的内存以及较多的CPU，可以让安装过程快速一些（本次选择的最小安装版本，是">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <title>CentOS 安装配置 1 | 个人博客</title>
    <link rel="icon" type="image/png" href="/favicon.png">

    <link rel="stylesheet" type="text/css" href="/libs/awesome/css/all.css">
    <link rel="stylesheet" type="text/css" href="/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/css/my.css">
    
    <script src="/libs/jquery/jquery.min.js"></script>
    
</head>


<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper head-container">
            <div class="brand-logo">
                <a href="/" class="waves-effect waves-light">
                    
                    <img src="/medias/logo.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">个人博客</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/contact" class="waves-effect waves-light">
      
      <i class="fas fa-comments" style="zoom: 0.6;"></i>
      
      <span>留言板</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>友情链接</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>

<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">个人博客</div>
        <div class="logo-desc">
            
            Never really desperate, only the lost of the soul.
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/contact" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-comments"></i>
			
			留言板
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			友情链接
		</a>
          
        </li>
        
        
        <li><div class="divider"></div></li>
        <li>
            <a href="https://github.com/BuddyXiao" class="waves-effect waves-light" target="_blank">
                <i class="fab fa-github-square fa-fw"></i>Fork Me
            </a>
        </li>
        
    </ul>
</div>

        </div>

        
            <style>
    .nav-transparent .github-corner {
        display: none !important;
    }

    .github-corner {
        position: absolute;
        z-index: 10;
        top: 0;
        right: 0;
        border: 0;
        transform: scale(1.1);
    }

    .github-corner svg {
        color: #0f9d58;
        fill: #fff;
        height: 64px;
        width: 64px;
    }

    .github-corner:hover .octo-arm {
        animation: a 0.56s ease-in-out;
    }

    .github-corner .octo-arm {
        animation: none;
    }

    @keyframes a {
        0%,
        to {
            transform: rotate(0);
        }
        20%,
        60% {
            transform: rotate(-25deg);
        }
        40%,
        80% {
            transform: rotate(10deg);
        }
    }
</style>

<a href="https://github.com/BuddyXiao" class="github-corner tooltipped hide-on-med-and-down" target="_blank"
   data-tooltip="Fork Me" data-position="left" data-delay="50">
    <svg viewBox="0 0 250 250" aria-hidden="true">
        <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
        <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
              fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
        <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
              fill="currentColor" class="octo-body"></path>
    </svg>
</a>
        
    </nav>

</header>

    



<div class="bg-cover pd-header post-cover" style="background-image: url('/medias/featureimages/2.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">CentOS 安装配置 1</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        width: 345px;
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        margin: 35px 0 15px 0;
        padding-left: 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content {
        height: calc(100vh - 250px);
        overflow: auto;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #toc-content .is-active-link::before {
        background-color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/tags/centos/">
                                <span class="chip bg-color">centos</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/categories/IT/" class="post-category">
                                IT
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2020-03-01
                </div>
                

                

                

                

                
            </div>

        </div>
        <hr class="clearfix">
        <div class="card-content article-card-content">
            <div id="articleContent">
                <h1 id="Centos安装配置-1"><a href="#Centos安装配置-1" class="headerlink" title="Centos安装配置 1"></a>Centos安装配置 1</h1><h2 id="简单修改"><a href="#简单修改" class="headerlink" title="简单修改"></a>简单修改</h2><ol>
<li><p>【创建虚拟机的配置】如果要想在虚拟机进行CentOS系统的安装，则一定要创建由一个新的虚拟机环境，同时在安装的过程之中尽可能提供较大的内存以及较多的CPU，可以让安装过程快速一些（本次选择的最小安装版本，是不带有常规服务的，几乎所有的服务都需要开发者自己进行配置）（root/xhf123456）</p>
</li>
<li><p>【修改字体大小】</p>
</li>
</ol>
<table>
<thead>
<tr>
<th>ls /lib/kbd/consolefonts</th>
<th>ls /lib/kbd/consolefonts |more (按字母’q’退出)</th>
</tr>
</thead>
<tbody><tr>
<td>setfont lat4-19</td>
<td></td>
</tr>
</tbody></table>
<p>将此设置为开机项(需要一个权限,可通过su获取管理员权限，exit退出管理员模式)</p>
<pre><code class="shell">echo &#39;setfont lat4-19&#39; &gt;&gt; /etc/bashrc</code></pre>
<p>管理员拥有的操作：重新启动(reboot)、关机(halt)</p>
<h2 id="SSH管理"><a href="#SSH管理" class="headerlink" title="SSH管理"></a>SSH管理</h2><p>在实际的工作之中为了解决系统管理问题，所以可以使用SSH工具进行系统的配置，这个服务可以直接进行命令的远程传输，而要想使用这个服务则必须要求开发者进行相应的组件安装。</p>
<ol>
<li>【检查SSH组件是否存在】在CentOS里面进行系统安装的时候虽然选择了最小化的系统环境，但是依然会有许多服务自动进行安装，所以首先检查一下当前系统里面是否已经有过<code>openssh</code>组件的存在：</li>
</ol>
<pre><code class="shell">rpm -qa | grep ssh</code></pre>
<ol start="2">
<li>【安装ssh】如果现在检查之后发现当前的系统里面没有SSH组件，那么最简单的解决方案就是直接通过<code>yum</code>命令安装：(参数’-y’表示确认，没有需要用户手动确认)</li>
</ol>
<pre><code class="shell">yum -y install openssh-server</code></pre>
<p>国内yum需要配置为阿里的镜像或清华的镜像比如具体配置参考：<br><a href="https://blog.csdn.net/xiaojin21cen/article/details/84726193?depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task" target="_blank" rel="noopener">https://blog.csdn.net/xiaojin21cen/article/details/84726193?depth_1-utm_source=distribute.pc_relevant.none-task&amp;utm_source=distribute.pc_relevant.none-task</a></p>
<ol start="3">
<li>【ssh配置】在默认情况下，openssh服务组件时不允许root账户登录的，所以应该将这样的配置取消</li>
</ol>
<table>
<thead>
<tr>
<th>打开ssh配置文件</th>
<th>vi  /etc/ssh/sshd_config</th>
</tr>
</thead>
<tbody><tr>
<td>修改配置项</td>
<td>PermitRootLogin yes (将存在的注释“#”取消即可)</td>
</tr>
</tbody></table>
<ol start="4">
<li>【重启SSH服务】由于此时配置文件已经修改了，所以如果要想进行新配置项的加载则必须进行服务的重新启动：</li>
</ol>
<table>
<thead>
<tr>
<th>停止SSH服务</th>
<th>/bin/systemctl stop sshd.service</th>
</tr>
</thead>
<tbody><tr>
<td>查看SSH服务</td>
<td>ps -ef | grep ssh</td>
</tr>
<tr>
<td>启动SSH服务</td>
<td>/bin/systemctl start sshd.service</td>
</tr>
</tbody></table>
<ol start="5">
<li>【客户端】现在相当于系统打开了一个SSH的操作通道，该通道默认情况下占用的端口为22端口，于是就可以使用一些前端工具进行Linux主机的连接。</li>
</ol>
<h2 id="系统环境配置"><a href="#系统环境配置" class="headerlink" title="系统环境配置"></a>系统环境配置</h2><p>对当前系统软件环境做一些修改</p>
<ol>
<li>【防火墙状态】在CentOS系统安装完成之后会自动的提供有防火墙，对于一些服务来讲如果过多的关注于防火墙的影响会比较的麻烦，所以为了简单起见，最好的方法就是查看一下是否存在有防火墙，如果存在则进行删除。</li>
</ol>
<pre><code>查看防火墙的状态
firewall-cmd --state
关闭防火墙
systemctl stop firewalld.service
删除防火墙启动
systemctl disable firewalld.service</code></pre><ol start="2">
<li>【组件卸载】在CentOS系统之中除了防火墙之外实际上还有一个iptables组件，可以考虑将这个组件卸载，这样就不再需要重复的进行ip规则的定义了</li>
</ol>
<pre><code>yum -y remove iptables</code></pre><ol start="3">
<li>【关闭SELinux】再CentOS系统里面为了方便的进行安全的配置，还提供了一个SELinux组件，这个组件继续使用，则每一次都需要进行各种的手工配置，这样对于学习不是很方便，所以选择禁用</li>
</ol>
<table>
<thead>
<tr>
<th>查看SELinux状态</th>
<th>getenforce</th>
</tr>
</thead>
<tbody><tr>
<td>打开配置文件</td>
<td>vi /etc/selinux/config</td>
</tr>
<tr>
<td>修改配置项</td>
<td>SELINUX=disabled</td>
</tr>
<tr>
<td>配置生效</td>
<td>reboot</td>
</tr>
</tbody></table>
<p>每一次只有再重新启动系统之后才会让新的SELinux配置生效（启动的时候需要加载配置文件）</p>
<ol start="4">
<li>【组件更新】再CentOS里面所有的组件都是基于yum命令进行管理的,那么为了方便起见可以将当前的yum环境更新：</li>
</ol>
<pre><code class="shell">yum -y update</code></pre>
<ol start="5">
<li>【依赖组件】当组件更新完成之后还需要进行一些额外组件的安装：</li>
</ol>
<pre><code class="shell">yum -y install make g++ gcc libpcre3 libpcrecpp* libpcre3-dev libssl-dev autoconf automake libtool libncurses5-dev libaio.dev net-tools wget autoconf libaio-devel.x84_64 tree</code></pre>
<p>这些组件里面有一些是为了后续进行C、C++源代码编译准备的程序以及相关的依赖库，同时还有一部分后其服务安装的支持包</p>
<h2 id="时区与时间"><a href="#时区与时间" class="headerlink" title="时区与时间"></a>时区与时间</h2><p>在使用虚拟机进行学习的过程之中，经常需要进行服务集群的搭建，而在服务集群之中，如果要想进行成功的服务提供，首先要保持的就是所有主机的时区和时间一定要同步。</p>
<ol>
<li>【设置时区】虽然现在的系统都可以自动的进行时区与时间同步，但是为了准确一些还是采用自定义配置模式（暗号：5 9 11）</li>
</ol>
<pre><code class="shell">tzselect</code></pre>
<ul>
<li><p>选择当前主机所在的位置，本次选择是在亚洲：5</p>
</li>
<li><p>选择用户所在国家的名称：9</p>
</li>
<li><p>选择所在的城市时区：1</p>
</li>
<li><p>是否做保存：1</p>
</li>
</ul>
<ol start="2">
<li>【组件安装】如果要想进行时间的同步处理，则一定要与国家的时间服务器进行同步，而如果要想实现这样的同步处理则必须安装有ntp的组件</li>
</ol>
<pre><code class="shell">yum -y install ntp ntpdate</code></pre>
<ol start="3">
<li>【同步时间】如果要想进行实践的同步则一定要有相应的时间服务器，而对于时间服务器来讲有很多，本次为了方便选择阿里云提供的时间服务器进行实践同步：</li>
</ol>
<pre><code class="shell">ntpdate -u ntp1.aliyun.com</code></pre>
<ol start="4">
<li>【保存配置】此时所实现的实践服务器的同步并没有保存在系统硬件之中，如果不保存则每一次都必须手工进行同步处理，所以最简单的做法是直接将其写入到硬件环境：</li>
</ol>
<pre><code class="shell">hwclock --systohc</code></pre>
<p>那么此时就可以保证在每一次重启CentOS系统之后都可以得到一个同步后的时间内容。</p>
<h2 id="FTP-文件服务"><a href="#FTP-文件服务" class="headerlink" title="FTP 文件服务"></a>FTP 文件服务</h2><p>FTP是一个文件传输协议，如果要进行一些CentOS系统文件内容的传输使用FTP会比较容易一些，在集群环境里面为了方便进行服务的配置，可以考虑手工上传一些文件，这样如果使用FTP就会比较方便。</p>
<ol>
<li>【安装组件】在CentOS系统默认安装的过程之中并没有提供FTP组件的应用，所以应该先通过服务器进行该组件的下载：</li>
</ol>
<pre><code class="shell">yum -y install vsftpd</code></pre>
<p>当组件安装完成之后实际上就会有一个ftp账户，而该账户对应有一个工作目录”/var/ftp”</p>
<ol start="2">
<li>【服务配置】如果要想使用FTP服务，则必须对FTP配置文件进行一些处理</li>
</ol>
<pre><code class="shell">vi /etc/vsftpd/vsftpd.conf</code></pre>
<table>
<thead>
<tr>
<th>行数</th>
<th>配置项</th>
<th>描述</th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>12</td>
<td>anonymous_enable=NO</td>
<td>不允许匿名访问</td>
<td></td>
</tr>
<tr>
<td>83</td>
<td>ascii_upload_enable=YES</td>
<td>允许上传ascii文件</td>
<td></td>
</tr>
<tr>
<td>84</td>
<td>ascii_download_enable=YES</td>
<td>允许下载ascii文件</td>
<td></td>
</tr>
<tr>
<td>86</td>
<td>ftpd_banner=Welcome to :<a href="http://www.fengfeng.com" target="_blank" rel="noopener">www.fengfeng.com</a></td>
<td>用户登录之后出现的提示信息</td>
<td></td>
</tr>
<tr>
<td>101</td>
<td>chroot_local_user=YES</td>
<td>只允许用户进行工作目录的访问</td>
<td></td>
</tr>
<tr>
<td>102</td>
<td>chroot_list_enable=YES</td>
<td>允许进行工作目录的列表</td>
<td></td>
</tr>
<tr>
<td>104</td>
<td>chroot_list_file=/etc/vsftpd/chroot_list</td>
<td>定义授权用户列表配置文件路径</td>
<td></td>
</tr>
<tr>
<td>末尾</td>
<td>allow_writeable_chroot=YES</td>
<td>(自己编写)允许进行文件的写入</td>
<td></td>
</tr>
</tbody></table>
<ol start="3">
<li>【密码配置】在ftp组件安装完成之后就需要进行ftp账户的密码配置，为了方便起见，本次使用的密码是”fengfeng@happy”</li>
</ol>
<pre><code class="shell">passwd ftp</code></pre>
<p>   密码需要输入两次</p>
<ol start="4">
<li>【FTP列表】如果想要使用ftp账户还需要做一个用户的列表文件：</li>
</ol>
<pre><code>vi /etc/vsftpd/chroot_list
输入
ftp</code></pre><ol start="5">
<li>【目录授权】ftp用户默认访问的路径为”/var/ftp”，所以为了方便上传处理，可以考虑将完全控制的权限交付给此目录：</li>
</ol>
<pre><code class="shell">chmod -R 777 /var/ftp</code></pre>
<ol start="6">
<li>【授权变更】以上的配置完成之后需要修改一下授权文件：(注释两行内容)</li>
</ol>
<pre><code class="shell">vi /etc/pam.d/vsftpd</code></pre>
<table>
<thead>
<tr>
<th>#auth  required  pam_listfile.so.item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed</th>
</tr>
</thead>
<tbody><tr>
<td>#auth  required  pam_shell.so</td>
</tr>
</tbody></table>
<ol start="7">
<li>【FTP命令】当配置完成之后就可以考虑直接启动FTP服务，关于FTP的控制命令有如下几种</li>
</ol>
<table>
<thead>
<tr>
<th>FTP服务启动</th>
<th>systemctl start vsftpd.service</th>
</tr>
</thead>
<tbody><tr>
<td>FTP服务关闭</td>
<td>systemctl stop vsftpd.service</td>
</tr>
<tr>
<td>FTP服务重启</td>
<td>systemctl restart vsftpd.service</td>
</tr>
</tbody></table>
<ol start="8">
<li>【自启动配置】此时已经成功的使用FTP服务了，但是对于当前的服务是每一次重新启动系统之后都需要手动开启，这样的方式肯定不方便，所以最好将其设置为自动启动：</li>
</ol>
<pre><code class="shell">systemctl enable vsftpd.service</code></pre>

            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="http://yoursite.com" rel="external nofollow noreferrer">肖和锋</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="http://yoursite.com/2020/03/01/centos%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE1/">http://yoursite.com/2020/03/01/centos%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE1/</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="http://yoursite.com" target="_blank">肖和锋</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/tags/centos/">
                                    <span class="chip bg-color">centos</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/libs/share/css/share.min.css">

<div id="article-share">
    
    
    <div class="social-share" data-sites="twitter,facebook,google,qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.4rem;
        line-height: 38px;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .close:hover {
        color: #ef5350;
        transform: scale(1.3);
        -moz-transform:scale(1.3);
        -webkit-transform:scale(1.3);
        -o-transform:scale(1.3);
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-content ul {
        padding-left: 0 !important;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        background-color: #ccc;
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff !important;
        background-color: #22AB38 !important;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff !important;
        background-color: #019FE8 !important;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fas fa-times"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="/medias/reward/alipay.jpg" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="/medias/reward/wechat.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>
            
        </div>
    </div>

    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/2020/03/01/centos%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE2/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/3.jpg" class="responsive-img" alt="CentOS 安装配置 2">
                        
                        <span class="card-title">CentOS 安装配置 2</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            CentOS安装配置 2MySQL 数据库的安装MySQL数据库最早就是在Linux环境下发展起来的，而且在国内也是使用最多的一种数据库，那么本次对MySQL的安装与配置进行讲解。只需要登录MySQL官网就可以下载Linux版本：https
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2020-03-01
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/IT/" class="post-category">
                                    IT
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/centos/">
                        <span class="chip bg-color">centos</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/2020/01/30/I%20have%20a%20dream/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/3.jpg" class="responsive-img" alt="I have a dream">
                        
                        <span class="card-title">I have a dream</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            I have a dream马丁·路德·金
I am happy to join with you today in what will go down in history as the greatest demonstration fo
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2020-01-30
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/%E6%94%B6%E8%97%8F/" class="post-category">
                                    收藏
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/english/">
                        <span class="chip bg-color">english</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>



<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/libs/codeBlock/codeShrink.js"></script>


<!-- 代码块折行 -->

<style type="text/css">
code[class*="language-"], pre[class*="language-"] { white-space: pre !important; }
</style>


    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('0'),
            headingSelector: 'h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>



    <footer class="page-footer bg-color">
    <div class="container row center-align" style="margin-bottom: 0px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            <span id="year">2019</span>
            <a href="http://yoursite.com" target="_blank">肖和锋</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
            
            
            
            
            
            <span id="busuanzi_container_site_pv">
                |&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;<span id="busuanzi_value_site_pv"
                    class="white-color"></span>&nbsp;次
            </span>
            
            
            <span id="busuanzi_container_site_uv">
                |&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;<span id="busuanzi_value_site_uv"
                    class="white-color"></span>&nbsp;人
            </span>
            
            <br>
            
            <br>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://github.com/BuddyXiao" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:1464078415@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>







    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=1464078415" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 1464078415" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>







    <a href="/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
        <i class="fas fa-rss"></i>
    </a>

</div>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script src="/js/search.js"></script>
<script type="text/javascript">
$(function () {
    searchFunc("/" + "search.xml", 'searchInput', 'searchResult');
});
</script>
    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/libs/materialize/materialize.min.js"></script>
    <script src="/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/libs/aos/aos.js"></script>
    <script src="/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/js/matery.js"></script>

    <!-- Global site tag (gtag.js) - Google Analytics -->


    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/libs/others/clicklove.js" async="async"></script>
    
    
    <script async src="/libs/others/busuanzi.pure.mini.js"></script>
    

    

    

    

    

    
    <script type="text/javascript" src="/libs/background/ribbon-dynamic.js" async="async"></script>
    
    
    
    <script src="/libs/instantpage/instantpage.js" type="module"></script>
    

</body>

</html>
